//|||||||||||||||||||||||||||||||||||||||||||||||

#ifndef GAME_STATE_HPP
#define GAME_STATE_HPP

//|||||||||||||||||||||||||||||||||||||||||||||||

#include "AppState.h"

//#include "DotSceneLoader.h"

#include <OgreSubEntity.h>
#include <OgreMaterialManager.h>

#include "GameManager.h"


#include "NotificationsOverlay.h"

//|||||||||||||||||||||||||||||||||||||||||||||||

enum QueryFlags
{
    QUERY_BLOCK	= 1<<0,
    QUERY_CHARACTER		= 1<<1,
    QUERY_BUILDING		= 1<<2,
    QUERY_ITEM		= 1<<3
};

//|||||||||||||||||||||||||||||||||||||||||||||||

class GameState : public AppState
{
public:
    GameState();

    DECLARE_APPSTATE_CLASS(GameState)

    void enter();
    void createScene();
    void exit();
    bool pause();
    void resume();

    void moveCamera();
    void getInput();
    void buildGUI();

    bool keyPressed(const OIS::KeyEvent &keyEventRef);
    bool keyReleased(const OIS::KeyEvent &keyEventRef);

    bool mouseMoved(const OIS::MouseEvent &arg);
    bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
    bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);

    void onLeftPressed(const OIS::MouseEvent &evt);
    void onRightPressed(const OIS::MouseEvent &evt);
    void itemSelected(OgreBites::SelectMenu* menu);

    void update(double timeSinceLastFrame);

private:


    OgreBites::ParamsPanel*		m_pDetailsPanel;
    bool				        m_bQuit;

    Ogre::Vector3			m_TranslateVector;
    Ogre::Real			    m_MoveSpeed;
    Ogre::Degree			m_RotateSpeed;
    float				    m_MoveScale;
    Ogre::Degree			m_RotScale;

    Ogre::RaySceneQuery*	m_pRSQ;
    Ogre::SceneNode*		m_pCurrentObject;
    Ogre::Entity*			m_pCurrentEntity;
    bool				    m_bLMouseDown, m_bRMouseDown;
    bool				    m_bSettingsMode;



    GameManager*            m_gameManager;


};

//|||||||||||||||||||||||||||||||||||||||||||||||

#endif

//|||||||||||||||||||||||||||||||||||||||||||||||
